﻿<!DOCTYPE html>

<html>
<head>
    <link href="/SiteUI/level1.css" rel="stylesheet" />
</head>
<body>
    <div class="view" id="Topview">
        <!--页面头部导航-->
        <div class="row" id="pageHead">
            <div class="col-lg-2" id="logo">
                <a href="/Index.html">
                    <br />
                    &nbsp;
                    <br />
                    &nbsp;
                </a>
            </div>
            <div class="col-lg-1" id="allMenu">
                更多应用
                <i class="soicon icon-navigatenext"></i>
            </div>
            <!--此处加载当前用户自定义的快捷模块入口-->
            <div class="col-lg-6">
                <div id="headNavi">
                    <div id="myDashbord"><a href="/MyBiz/Dashbord.html">工作桌面</a></div>
                    <ul id="myMenu"></ul>
                </div>
            </div>
            <!--此处加载用户个人菜单-->
            <div class="col-lg-3" id="userBar">
                <ul>
                    <li class="userBar_menu" id="userHead">
                        <img />
                        <a href="/Index.html">登录</a>
                    </li>
                    <li class="userBar_menu" id="sysAlert">
                        <i class="soicon icon-notifications"></i>
                        <em>0</em>
                    </li>
                    <li>
                        <a class="Lite" id="Logout" target="_self" href="#"><i class="soicon icon-powersettingsnew"></i>安全退出</a>
                    </li>
                </ul>
            </div>

            <!--浮动内容-->
            <div class="row">
                <div class="col-lg-7 col-lg-offset-2">
                    <div class="row" id="pvFullMenu">
                        <a id="lnkSetMyNavi" class="LinkTo" href="/MyBiz/MyNavi.html">选择我的常用导航</a>
                    </div>
                </div>
                <div class="col-lg-2 col-lg-offset-9">
                    <div id="pvAcntInfo">
                        <a class="Lite" href="/MyBiz/Index.html"><i class="soicon icon-accountcircle"></i>个人资料</a>
                        <a class="Lite" href="/MyBiz/MyNavi.html"><i class="soicon icon-fenlei"></i>我的应用</a>
                        <a class="Lite" href="/MyBiz/MyMessage.html"><i class="soicon icon-chat"></i>消息中心</a>
                    </div>
                </div>
                <div class="col-lg-4 col-lg-offset-9">
                    <div id="pvMyAlerts">
                        <h4></h4>
                    </div>
                </div>
            </div>
        </div>

        <!--页面主体内容-->
        <div class="row" id="pageContent" section="PageBody">
        </div>

        <!--页脚-->
        <div class="row" id="pageFoot" data-src="/common/pageFoot.html">

        </div>

        <div id="pageHelper">
            <ul>
                <li id="goTop"></li>
            </ul>
        </div>
    </div>

    <div id="tplPrompt" style="display:none">
        <div class="prompt_success">
            <div class="p_body">
                <h4>title</h4>
                <span>message</span>
            </div>
        </div>
        <div class="prompt_info">
            <div class="p_body">
                <h4>title</h4>
                <span>message</span>
            </div>
        </div>
        <div class="prompt_err">
            <div class="p_body">
                <h4>title</h4>
                <span>message</span>
            </div>
        </div>
    </div>

    <div class="Searcher">
        <div class="searchInput">
            <input placeholder="订货日期/订单编号/联系人名称/手机号/公司名称" />
            <div class="button btnGO">搜索</div>
        </div>
        <span>常用搜索：</span><a class="todayOrder" target="_blank" href="/MyBiz/Find?key=">今日订单</a>
    </div>

    <script>
        View = {
            getUserInfoEnd: function (rtn) {
                //安全退出
                $("#Logout").click(function () {
                    location.href = "/SoBiz/Loginout";
                });
                if (User.headimg) {
                    $("#userHead>img").attr("src", User.headimg);
                }
                $("#userHead>a").vl(User.realname||User.username).attr("src", "/MyBiz/Index.html");
                if (User.setting&&User.setting.SubSystems) {
                    User.setting.SubSystems.forEach(function (s) {
                        if (s.Items) {
                            s.Items.forEach(function (itm) {
                                if (itm.Active == true) {
                                    var lnk = $("<li>");
                                    lnk.append($("<a class='Lite'>").attr("href", itm.Url).vl(itm.Title));
                                    lnk.appendTo("#myMenu");
                                }
                            })
                        }
                    })
                }
            },
            onWndScroll:function(ev){
                var bst = $(window).scrollTop();
                if (bst > 400) {
                    $("#goTop").fadeIn();
                }
                else {
                    $("#goTop").fadeOut();
                }
            },
            pnlAcntInfo: null,
            pnlMyAlerts: null,
            onHelp: function (ev) {
                if (ev && ev.currentTarget) {
                    switch (ev.currentTarget.ID()) {
                        case "goTop":
                            $("html").animate({ scrollTop: 0 }, 'normal');
                            $("body").animate({ scrollTop: 0 }, 'normal');
                            break;
                    }
                }
            }
        };

        SoBiz.Ready(function (e) {
            //动态加载更多应用
            var html = "";
            for (var i = 0; i < fullSetting.SubSystems.length; i++) {
                html += "<div class='col-lg-12 mnu_group'>";
                html += "<div class='row mnu_group_title'>";
                html += "<i class='" + fullSetting.SubSystems[i].icon + "'>" + fullSetting.SubSystems[i].Title + "</i>";
                html += "</div>";
                html += "<div class='row mnu_items'>";
                for (var j = 0; j < fullSetting.SubSystems[i].Items.length; j++) {
                    html += "<a class='LinkTo' href='" + fullSetting.SubSystems[i].Items[j].Url + "'>" + fullSetting.SubSystems[i].Items[j].Title + "</a>";
                }
                html += "</div>";
                html += "</div>";
            }
            $("#pvFullMenu").append(html);
            $(window).on("scroll", View.onWndScroll);
            $("#pageHelper").delegate("li", "click", View.onHelp);

            //初始化全部应用菜单
            View.pnlFullMenu = new LiberUI.PopPanel("#pvFullMenu");
            View.pnlFullMenu.PopFor("#allMenu")
                            .option("ShowWay", function (elm) {
                                elm.addClass("active");
                                this.PopFor().addClass("hot");
                            })
                            .option("HideWay", function (elm) {
                                elm.removeClass("active");
                                this.PopFor().removeClass("hot");
                            })
                            .option("AutoPopout", true);


            //初始化用户状态扩展信息面板
            View.pnlAcntInfo = new LiberUI.PopPanel("#pvAcntInfo");

            View.pnlAcntInfo.PopFor("#userHead")
                            .option("ShowWay", function (elm) {
                                elm.addClass("active");
                                this.PopFor().addClass("hot");
                            })
                            .option("HideWay", function (elm) {
                                elm.removeClass("active");
                                this.PopFor().removeClass("hot");
                            })
                            .option("AutoPopout", true);

            View.pnlMyAlerts = new LiberUI.PopPanel("#pvMyAlerts");
            View.pnlMyAlerts.PopFor("#sysAlert")
                            .option("ShowWay", function (elm) {
                                elm.addClass("active");
                                this.PopFor().addClass("hot");
                            })
                            .option("HideWay", function (elm) {
                                elm.removeClass("active");
                                this.PopFor().removeClass("hot");
                            })
                            .option("AutoPopout", true);
            SoBiz.Login(View.getUserInfoEnd);
        });
    </script>

    <script>
    window.success = function (title,msg, delay, fnCallback) {
        var cnt = $("#tplPrompt>.prompt_success").clone();
        cnt.children(".p_body").children("h4").vl(title);
        cnt.children(".p_body").children("span").vl(msg);
        var p = new LiberUI.Prompt(cnt);
        p.option("Delay", delay);
        p.update();
        if (ObjHelper.IsFunc(fnCallback)) {
            p.on("disposed", fnCallback);
        }
        return p.show();

    };
    window.info = function (title,msg, delay,fnCallback) {
        var cnt = $("#tplPrompt>.prompt_info").clone();
        cnt.children(".p_body").children("h4").vl(title);
        cnt.children(".p_body").children("span").vl(msg);
        var p = new LiberUI.Prompt(cnt);
        p.option("Delay", delay);
        p.update();
        if (ObjHelper.IsFunc(fnCallback)) {
            p.on("disposed", fnCallback);
        }
        return p.show();
    };
    window.error = function (title, msg, delay, fnCallback) {
        var cnt = $("#tplPrompt>.prompt_err").clone();
        cnt.children(".p_body").children("h4").vl(title);
        cnt.children(".p_body").children("span").vl(msg);
        var p = new LiberUI.Prompt(cnt);
        p.option("Delay", delay);
        p.update();
        if (ObjHelper.IsFunc(fnCallback)) {
            p.on("disposed", fnCallback);
        }
        return p.show();
    };

    $(".Searcher>.todayOrder").attr("href", "/MyBiz/Find?key=" + new Date().toString());
    $(".searchInput>.btnGO").on("click", function () {
        var k = $(".searchInput>input").vl();
        if (k) {
            window.open("/MyBiz/Find?key=" + escape(k));
        }
    });
    KeybordHelper.on($(".searchInput>input"), "enter", function () {
        var k = $(".searchInput>input").vl();
        if (k) {
            window.open("/MyBiz/Find?key=" + escape(k));
        }
    });
    </script>
</body>
</html>

